import MagicValue from "./MagicValue";

export default class StringUtils {
    public static split(str: string, regex: string): string[] {
        return str.split(regex);
    }

    public static isNotBlank(str: string): boolean {
        return !StringUtils.isBlank(str);
    }

    public static isBlank(str: string): boolean {
        if (!str) {
            return true;
        }

        if (str === MagicValue.EMPTY_STRING) {
            return true;
        }

        return str.trim() === MagicValue.EMPTY_STRING;
    }
}
